package sg4c.frontend.command;

import java.io.IOException;
import sg4c.frontend.GraphicsContext;
import sg4c.protocol.DataInputProtocol;

public class Rotate implements GraphicsCommand {

    
    private final float angle;

    public Rotate(float angle) {
        this.angle = angle;
    }

    public void execute(GraphicsContext context) {
        context.getGraphics().rotate(angle);
    }
    
    public static final Factory factory = new Factory() {
        public GraphicsCommand parse(DataInputProtocol in) throws IOException {
            return new Rotate(in.readFloat());
        }
    };
}
